home *** CD-ROM | disk | FTP | other *** search
/ SGI Desktop Special Edition 1.1 / SGI Desktop Special Edition 1.1.iso / dist / mmail.idb / usr / lib / Zmail / bin / run_swin.z / run_swin
Encoding:
Text File  |  1995-11-13  |  1.3 KB  |  30 lines

  1. #!/bin/sh
  2.  
  3. if [ $# -ne 2 ]; then
  4.     echo "Usage: run_swin application filename"
  5.     exit 1
  6. fi
  7.  
  8. APP=$1
  9. FILENAME=$2
  10.  
  11. EXE="win $APP"
  12. FILE=`echo $FILENAME | sed 's/.*\/\(.*\)$/\1/'`
  13. NUMDOTS=`echo $FILE | sed 's/[^.]*//g' | wc -c | awk '{print $1}'`
  14. if [ $NUMDOTS -le 2 ]; then
  15.     if `echo $FILE | awk '{FS="."; error = 0 } length($1) > 8 {error = 1} length($2) > 3 {error = 1} {if (error == 1) {exit
  16. 1} else {exit 0}} {error = 0}'`; then
  17.         if [ -z "`ps -ef|grep ' swin'|grep -v grep`" ]; then
  18.             ARGS="j:\\$FILE"
  19.             PARSED_ARGS="net use j: `dirname $FILENAME`;$EXE $ARGS"
  20.             /usr/lib/SoftWindows/bin/SoftWindows -c "$PARSED_ARGS"
  21.         else
  22.             /usr/bin/X11/xconfirm -noframe -icon error -header "Notice" -B "OK" -t "SoftWindows is already running on your system." -t "You may open this file from within the current SoftWindows session." 1> /dev/null 2> /dev/null
  23.         fi
  24.     else
  25.         /usr/bin/X11/xconfirm -noframe -icon warning -header "Warning!" -B "Accept" -t "Filename or extension is too long!  Not a valid DOS filename!" 1> /dev/null 2> /dev/null
  26.     fi
  27. else
  28.     /usr/bin/X11/xconfirm -noframe -icon warning -header "Warning!" -B "Accept" -t "Too many periods in the filename!  Not a valid DOS filename!" 1> /dev/null 2> /dev/null
  29. fi
  30.